<template>
    <div class="app-container">
        <common-header :title="title">
            <template #right>
                <div>
                    <i class="iconfont">&#xe616;</i>
                </div>
            </template> 
        </common-header>
        <div v-html="privacyData" class="content"></div>
    </div>
</template>
<script>
import CommonHeader from '@/common/header/CommonHeader';
import { GetAgreement } from "@/api/index";
import { Toast } from 'vant';

export default {
    name: 'Privacy',
    components: {
        CommonHeader
    },
    data() {
        return {
            title: '用户隐私政策',
            privacyData: ''
        }
    },
    mounted(){
        this.getPrivacyData();
    },
    methods:{
         getPrivacyData() {
            const toast1 = Toast.loading({
                loadingType: 'spinner',
                duration: 0,
            });
            GetAgreement().then(res => {
                toast1.clear();
                res = res.data;
                if (res.code) {
                    this.privacyData = res.data.privacy_text;
                } else {
                    Toast({
                        message: res.msg,
                        position: 'bottom',
                        duration: 3000,
                    });
                }
            });
        }
    },
}
</script>
<style lang="less" scoped>
.content{
    width: 94%;
    margin: auto;
}
</style>